/*
 * @Author: JYJ 
 * @Date: 2020-07-11 22:10:13 
 * @Desc: 消息解析基类
 */
namespace gf {
    export interface BaseMsg {
        /**
         * 接收消息处理
         * @param msg
         */
        receive(socket: egret.WebSocket): void;

        /**
         * 发送消息处理
         * @param msg
         */
        send(socket: egret.WebSocket, msgID: number, msg: any): void;

        /**
         * 消息解析,返回格式{key:XX, body:XX}
         * @param msg
         */
        decode(msg: any): any;

        /**
         * 消息封装
         * @param msg
         */
        encode(msgID: number, msg: any): any;
    }
}
